import request from '@/utils/request'

// 获取全局阶梯水费配置
export function getGlobalTiers() {
  return request({
    url: '/admin/global-water-price-tier/tiers',
    method: 'get'
  })
}

// 保存全局阶梯水费配置
export function saveGlobalTiers(tiers) {
  return request({
    url: '/admin/global-water-price-tier/tiers',
    method: 'post',
    data: tiers
  })
}

// 计算全局阶梯水费
export function calculateGlobalTieredPrice(usageAmount) {
  return request({
    url: '/admin/global-water-price-tier/calculate',
    method: 'post',
    params: { usageAmount }
  })
}

// 初始化默认全局阶梯水费配置
export function initializeDefaultTiers() {
  return request({
    url: '/admin/global-water-price-tier/initialize',
    method: 'post'
  })
}
